#!/usr/bin/env 9 rc
# acme interface for browsing reddit
# This is free and unencumbered software released into the public domain.
# See UNLICENSE for more details.

roadrunner $1 | 9p write acme/new/body
last=`{9p ls acme | sort -g | tail -n 1}
echo "name http://reddit.com/r/$1" | 9p write acme/$last/ctl
echo -n "clean" | 9p write acme/$last/ctl
echo -n "0,0" | 9p write acme/$last/addr
echo -n "dot=addr" | 9p write acme/$last/ctl
echo -n "show" | 9p write acme/$last/ctl